<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试</title>
    <script src="../script/angular.min.js"></script>
    <script type="text/javascript">
        function test() {
             if(m==null||m=="") m=$$scope.data.name;
            alert(m+"吃屎了")
        }


    </script>
</head>
<body>
<div ng-app="">
    <p>
        姓名:<input type="text" ng-model="data.name"/>
        <input type="button" onclick="test();" value="点一下"/>
    </p>
</div>
</body>
</html>